import request from '@/util/request'
import { dealOpts, FIRM } from './../api_type'

// department
const firmGetDepartments = (params, opts) => {
  return request.get(dealOpts(FIRM + '/getDepartments', opts), params)
}

const firmCreateDepartments = (params, opts) => {
  return request.get(dealOpts(FIRM + '/createDepartment', opts), params)
}

const firmUpdateDepartments = (params, opts) => {
  return request.get(dealOpts(FIRM + '/modifyDepartment', opts), params)
}

const firmDeleteDepartments = (params, opts) => {
  return request.get(dealOpts(FIRM + '/deleteDepartment', opts), params)
}

const firmGetDeptstaffs = (params, opts) => {
  return request.get(dealOpts(FIRM + '/getDeptStaffs', opts), params)
}

const firmGetExternalStaffs = (params, opts) => {
  return request.get(dealOpts(FIRM + '/getExternalStaffs', opts), params)
}

const firmAddDeptStaff = (params, opts) => {
  return request.get(dealOpts(FIRM + '/addDeptStaff', opts), params)
}

const firmDeleteDeptStaff = (params, opts) => {
  return request.get(dealOpts(FIRM + '/deleteDeptStaff', opts), params)
}

export default {
  // department
  firmGetDepartments,
  firmCreateDepartments,
  firmUpdateDepartments,
  firmDeleteDepartments,
  firmGetDeptstaffs,
  firmGetExternalStaffs,
  firmAddDeptStaff,
  firmDeleteDeptStaff
}
